<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Action | Redux 中文文档 Join the chat at https://gitter.im/camsong/redux-in-chinese</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.3.3">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-edit-link/plugin.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-prism/prism.css">
        
    
    

        
    
    
    <link rel="next" href="../../docs/faq/CodeStructure.html" />
    
    
    <link rel="prev" href="../../docs/faq/StoreSetup.html" />
    

        
    </head>
    <body>
        
        
    <div class="book" data-level="5.5" data-basepath="../.." data-revision="Thu Mar 16 2017 23:41:56 GMT+0800 (CST)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        自述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="docs/introduction/index.html">
            
                
                    <a href="../../docs/introduction/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="docs/introduction/Motivation.html">
            
                
                    <a href="../../docs/introduction/Motivation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        动机
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="docs/introduction/CoreConcepts.html">
            
                
                    <a href="../../docs/introduction/CoreConcepts.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        核心概念
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="docs/introduction/ThreePrinciples.html">
            
                
                    <a href="../../docs/introduction/ThreePrinciples.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        三大原则
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="docs/introduction/PriorArt.html">
            
                
                    <a href="../../docs/introduction/PriorArt.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        先前技术
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="docs/introduction/Ecosystem.html">
            
                
                    <a href="../../docs/introduction/Ecosystem.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        生态系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="docs/introduction/Examples.html">
            
                
                    <a href="../../docs/introduction/Examples.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        示例
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="docs/basics/index.html">
            
                
                    <a href="../../docs/basics/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        基础
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="docs/basics/Actions.html">
            
                
                    <a href="../../docs/basics/Actions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Action
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="docs/basics/Reducers.html">
            
                
                    <a href="../../docs/basics/Reducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        Reducer
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="docs/basics/Store.html">
            
                
                    <a href="../../docs/basics/Store.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        Store
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="docs/basics/DataFlow.html">
            
                
                    <a href="../../docs/basics/DataFlow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        数据流
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="docs/basics/UsageWithReact.html">
            
                
                    <a href="../../docs/basics/UsageWithReact.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        搭配 React
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="docs/basics/ExampleTodoList.html">
            
                
                    <a href="../../docs/basics/ExampleTodoList.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        示例：Todo List
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="docs/advanced/index.html">
            
                
                    <a href="../../docs/advanced/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        高级
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="docs/advanced/AsyncActions.html">
            
                
                    <a href="../../docs/advanced/AsyncActions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        异步 Action
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="docs/advanced/AsyncFlow.html">
            
                
                    <a href="../../docs/advanced/AsyncFlow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        异步数据流
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="docs/advanced/Middleware.html">
            
                
                    <a href="../../docs/advanced/Middleware.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Middleware
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="docs/advanced/UsageWithReactRouter.html">
            
                
                    <a href="../../docs/advanced/UsageWithReactRouter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        搭配 React Router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="docs/advanced/ExampleRedditAPI.html">
            
                
                    <a href="../../docs/advanced/ExampleRedditAPI.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        示例：Reddit API
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="docs/advanced/NextSteps.html">
            
                
                    <a href="../../docs/advanced/NextSteps.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        下一步
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="docs/recipes/index.html">
            
                
                    <a href="../../docs/recipes/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        技巧
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="docs/recipes/MigratingToRedux.html">
            
                
                    <a href="../../docs/recipes/MigratingToRedux.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        迁移到 Redux
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="docs/recipes/UsingObjectSpreadOperator.html">
            
                
                    <a href="../../docs/recipes/UsingObjectSpreadOperator.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        使用对象展开运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="docs/recipes/ReducingBoilerplate.html">
            
                
                    <a href="../../docs/recipes/ReducingBoilerplate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        减少样板代码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="docs/recipes/ServerRendering.html">
            
                
                    <a href="../../docs/recipes/ServerRendering.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        服务端渲染
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="docs/recipes/WritingTests.html">
            
                
                    <a href="../../docs/recipes/WritingTests.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        编写测试
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="docs/recipes/ComputingDerivedData.html">
            
                
                    <a href="../../docs/recipes/ComputingDerivedData.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        计算衍生数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="docs/recipes/ImplementingUndoHistory.html">
            
                
                    <a href="../../docs/recipes/ImplementingUndoHistory.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        实现撤销重做
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="docs/recipes/IsolatingSubapps.html">
            
                
                    <a href="../../docs/recipes/IsolatingSubapps.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        子应用隔离
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="docs/recipes/StructuringReducers.html">
            
                
                    <a href="../../docs/recipes/StructuringReducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.</b>
                        
                        组织 Reducer
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.9.1" data-path="docs/recipes/reducers/PrerequisiteConcepts.html">
            
                
                    <a href="../../docs/recipes/reducers/PrerequisiteConcepts.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.1.</b>
                        
                        Reducer 基础概念
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.2" data-path="docs/recipes/reducers/BasicReducerStructure.html">
            
                
                    <a href="../../docs/recipes/reducers/BasicReducerStructure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.2.</b>
                        
                        Reducer 基础结构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.3" data-path="docs/recipes/reducers/SplittingReducerLogic.html">
            
                
                    <a href="../../docs/recipes/reducers/SplittingReducerLogic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.3.</b>
                        
                        Reducer 逻辑拆分
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.4" data-path="docs/recipes/reducers/RefactoringReducersExample.html">
            
                
                    <a href="../../docs/recipes/reducers/RefactoringReducersExample.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.4.</b>
                        
                        Reducer 重构示例
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.5" data-path="docs/recipes/reducers/UsingCombineReducers.html">
            
                
                    <a href="../../docs/recipes/reducers/UsingCombineReducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.5.</b>
                        
                        `combineReducers` 用法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.6" data-path="docs/recipes/reducers/BeyondCombineReducers.html">
            
                
                    <a href="../../docs/recipes/reducers/BeyondCombineReducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.6.</b>
                        
                        `combineReducers` 进阶
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.7" data-path="docs/recipes/reducers/NormalizingStateShape.html">
            
                
                    <a href="../../docs/recipes/reducers/NormalizingStateShape.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.7.</b>
                        
                        State 范式化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.8" data-path="docs/recipes/reducers/UpdatingNormalizedData.html">
            
                
                    <a href="../../docs/recipes/reducers/UpdatingNormalizedData.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.8.</b>
                        
                        管理范式化数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.9" data-path="docs/recipes/reducers/ReusingReducerLogic.html">
            
                
                    <a href="../../docs/recipes/reducers/ReusingReducerLogic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.9.</b>
                        
                        Reducer 逻辑复用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.10" data-path="docs/recipes/reducers/ImmutableUpdatePatterns.html">
            
                
                    <a href="../../docs/recipes/reducers/ImmutableUpdatePatterns.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.10.</b>
                        
                        不可变更新模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9.11" data-path="docs/recipes/reducers/InitializingState.html">
            
                
                    <a href="../../docs/recipes/reducers/InitializingState.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.11.</b>
                        
                        初始化 State
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="docs/FAQ.html">
            
                
                    <a href="../../docs/FAQ.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        常见问题
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="docs/faq/General.html">
            
                
                    <a href="../../docs/faq/General.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        综合
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="docs/faq/Reducers.html">
            
                
                    <a href="../../docs/faq/Reducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        Reducer
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="docs/faq/OrganizingState.html">
            
                
                    <a href="../../docs/faq/OrganizingState.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        组织 State
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="docs/faq/StoreSetup.html">
            
                
                    <a href="../../docs/faq/StoreSetup.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        创建 Store
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="5.5" data-path="docs/faq/Actions.html">
            
                
                    <a href="../../docs/faq/Actions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        Action
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="docs/faq/CodeStructure.html">
            
                
                    <a href="../../docs/faq/CodeStructure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        代码结构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="docs/faq/Performance.html">
            
                
                    <a href="../../docs/faq/Performance.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        性能
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="docs/faq/ReactRedux.html">
            
                
                    <a href="../../docs/faq/ReactRedux.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        React Redux
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="docs/faq/Miscellaneous.html">
            
                
                    <a href="../../docs/faq/Miscellaneous.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        其它
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="docs/Troubleshooting.html">
            
                
                    <a href="../../docs/Troubleshooting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        排错
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="docs/Glossary.html">
            
                
                    <a href="../../docs/Glossary.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        词汇表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="docs/api/index.html">
            
                
                    <a href="../../docs/api/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        API 文档
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="docs/api/createStore.html">
            
                
                    <a href="../../docs/api/createStore.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        createStore
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="docs/api/Store.html">
            
                
                    <a href="../../docs/api/Store.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        Store
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="docs/api/combineReducers.html">
            
                
                    <a href="../../docs/api/combineReducers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        combineReducers
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="docs/api/applyMiddleware.html">
            
                
                    <a href="../../docs/api/applyMiddleware.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        applyMiddleware
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="docs/api/bindActionCreators.html">
            
                
                    <a href="../../docs/api/bindActionCreators.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        bindActionCreators
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.6" data-path="docs/api/compose.html">
            
                
                    <a href="../../docs/api/compose.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.6.</b>
                        
                        compose
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="docs/react-redux/index.html">
            
                
                    <a href="../../docs/react-redux/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        react-redux 文档
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="docs/react-redux/api.html">
            
                
                    <a href="../../docs/react-redux/api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        API
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="docs/react-redux/troubleshooting.html">
            
                
                    <a href="../../docs/react-redux/troubleshooting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.2.</b>
                        
                        排错
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" >
            
                
                    <a target="_blank" href="https:/github.com/react-guide/redux-tutorial-cn">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        redux-tutorial
                    </a>
            
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                Published with GitBook
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    
    


    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Redux 中文文档 Join the chat at https://gitter.im/camsong/redux-in-chinese</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <a id="edit-link" href="https://github.com/camsong/redux-in-chinese/tree/master/docs/faq/Actions.md" class="btn fa fa-edit pull-left">&#xA0;&#xA0;&#x5F00;&#x59CB;&#x7EA0;&#x9519;</a><h1 id="redux-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%EF%BC%9Aaction">Redux &#x5E38;&#x89C1;&#x95EE;&#x9898;&#xFF1A;Action</h1>
<h2 id="%E7%9B%AE%E5%BD%95">&#x76EE;&#x5F55;</h2>
<ul>
<li><a href="#actions-string-constants">&#x4E3A;&#x4F55; type &#x5FC5;&#x987B;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6216;&#x8005;&#x81F3;&#x5C11;&#x53EF;&#x4EE5;&#x88AB;&#x5E8F;&#x5217;&#x5316;&#xFF1F; &#x4E3A;&#x4EC0;&#x4E48; action &#x7C7B;&#x578B;&#x5E94;&#x8BE5;&#x4F5C;&#x4E3A;&#x5E38;&#x91CF;&#xFF1F;</a></li>
<li><a href="#actions-reducer-mappings">&#x662F;&#x5426;&#x5B58;&#x5728; reducer &#x548C; action &#x4E4B;&#x95F4;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x6620;&#x5C04;&#xFF1F;</a></li>
<li><a href="#actions-side-effects">&#x600E;&#x6837;&#x8868;&#x793A;&#x7C7B;&#x4F3C; AJAX &#x8BF7;&#x6C42;&#x7684; &#x201C;&#x526F;&#x4F5C;&#x7528;&#x201D;&#xFF1F;&#x4E3A;&#x4F55;&#x9700;&#x8981; &#x201C;action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x201D;&#x3001;&#x201C;thunk&#x201D; &#x4EE5;&#x53CA; &#x201C;middleware&#x201D; &#x7C7B;&#x4F3C;&#x7684;&#x4E1C;&#x897F;&#x53BB;&#x5904;&#x7406;&#x5F02;&#x6B65;&#x884C;&#x4E3A;&#xFF1F;</a></li>
<li><a href="#actions-multiple-actions">&#x662F;&#x5426;&#x5E94;&#x8BE5;&#x5728; action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x4E2D;&#x8FDE;&#x7EED;&#x5206;&#x53D1;&#x591A;&#x4E2A; action&#xFF1F;</a></li>
</ul>
<h2 id="actions">Actions</h2>
<p><a id="actions-string-constants"></a></p>
<h3 id="%E4%B8%BA%E4%BD%95-type-%E5%BF%85%E9%A1%BB%E6%98%AF%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E6%88%96%E8%80%85%E8%87%B3%E5%B0%91%E5%8F%AF%E4%BB%A5%E8%A2%AB%E5%BA%8F%E5%88%97%E5%8C%96%EF%BC%9F-%E4%B8%BA%E4%BB%80%E4%B9%88-action-%E7%B1%BB%E5%9E%8B%E5%BA%94%E8%AF%A5%E4%BD%9C%E4%B8%BA%E5%B8%B8%E9%87%8F%EF%BC%9F">&#x4E3A;&#x4F55; <code>type</code> &#x5FC5;&#x987B;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6216;&#x8005;&#x81F3;&#x5C11;&#x53EF;&#x4EE5;&#x88AB;&#x5E8F;&#x5217;&#x5316;&#xFF1F; &#x4E3A;&#x4EC0;&#x4E48; action &#x7C7B;&#x578B;&#x5E94;&#x8BE5;&#x4F5C;&#x4E3A;&#x5E38;&#x91CF;&#xFF1F;</h3>
<p>&#x548C; state &#x4E00;&#x6837;&#xFF0C;&#x53EF;&#x5E8F;&#x5217;&#x5316;&#x7684; action &#x4F7F;&#x5F97;&#x82E5;&#x5E72; Redux &#x7684;&#x7ECF;&#x5178;&#x7279;&#x6027;&#x53D8;&#x5F97;&#x53EF;&#x80FD;&#xFF0C;&#x6BD4;&#x5982;&#x65F6;&#x95F4;&#x65C5;&#x884C;&#x8C03;&#x8BD5;&#x5668;&#x3001;&#x5F55;&#x5236;&#x548C;&#x91CD;&#x653E; action&#x3002;&#x82E5;&#x4F7F;&#x7528; <code>Symbol</code> &#x7B49;&#x53BB;&#x5B9A;&#x4E49; <code>type</code> &#x503C;&#xFF0C;&#x6216;&#x8005;&#x7528; <code><span class="token keyword">instanceof</span></code> &#x5BF9; action &#x505A;&#x81EA;&#x68C0;&#x67E5;&#x90FD;&#x4F1A;&#x7834;&#x574F;&#x8FD9;&#x4E9B;&#x7279;&#x6027;&#x3002;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x53EF;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x3001;&#x81EA;&#x89E3;&#x91CA;&#x578B;&#xFF0C;&#x6240;&#x4EE5;&#x662F;&#x66F4;&#x597D;&#x7684;&#x9009;&#x62E9;&#x3002;&#x6CE8;&#x610F;&#xFF0C;&#x5982;&#x679C; action &#x76EE;&#x7684;&#x662F;&#x5728; middleware &#x4E2D;&#x5904;&#x7406;&#xFF0C;&#x90A3;&#x4E48;&#x4F7F;&#x7528; Symbols&#x3001; Promises &#x6216;&#x8005;&#x5176;&#x5B83;&#x975E;&#x53EF;&#x5E8F;&#x5217;&#x5316;&#x503C;&#x4E5F;&#x662F; <em>&#x53EF;&#x4EE5;</em> &#x7684;&#x3002; action &#x53EA;&#x6709;&#x5F53;&#x5B83;&#x4EEC;&#x6B63;&#x771F;&#x5230;&#x8FBE; store &#x4E14;&#x88AB;&#x4F20;&#x9012;&#x7ED9; reducer &#x65F6;&#x624D;&#x9700;&#x8981;&#x88AB;&#x5E8F;&#x5217;&#x5316;&#x3002;</p>
<p>&#x56E0;&#x4E3A;&#x6027;&#x80FD;&#x539F;&#x56E0;&#xFF0C;&#x6211;&#x4EEC;&#x65E0;&#x6CD5;&#x5F3A;&#x5236;&#x5E8F;&#x5217;&#x5316; action&#xFF0C;&#x6240;&#x4EE5; Redux &#x53EA;&#x4F1A;&#x6821;&#x9A8C; action &#x662F;&#x5426;&#x662F;&#x666E;&#x901A;&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA; <code>type</code> &#x662F;&#x5426;&#x5B9A;&#x4E49;&#x3002;&#x5176;&#x5B83;&#x7684;&#x90FD;&#x4EA4;&#x7531;&#x4F60;&#x51B3;&#x5B9A;&#xFF0C;&#x4F46;&#x662F;&#x786E;&#x4FDD;&#x6570;&#x636E;&#x662F;&#x53EF;&#x5E8F;&#x5217;&#x5316;&#x5C06;&#x5BF9;&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x95EE;&#x9898;&#x7684;&#x91CD;&#x73B0;&#x6709;&#x5F88;&#x5927;&#x5E2E;&#x52A9;&#x3002;</p>
<p>&#x5C01;&#x88C5;&#x5E76;&#x96C6;&#x805A;&#x516C;&#x5171;&#x4EE3;&#x7801;&#x662F;&#x7A0B;&#x5E8F;&#x89C4;&#x5212;&#x65F6;&#x7684;&#x6838;&#x5FC3;&#x6982;&#x5FF5;&#x3002;&#x867D;&#x7136;&#x53EF;&#x4EE5;&#x5728;&#x4EFB;&#x4F55;&#x5730;&#x65B9;&#x624B;&#x52A8;&#x521B;&#x5EFA; action &#x5BF9;&#x8C61;&#x3001;&#x624B;&#x52A8;&#x6307;&#x5B9A; <code>type</code> &#x503C;&#xFF0C;&#x5B9A;&#x4E49;&#x5E38;&#x91CF;&#x7684;&#x65B9;&#x5F0F;&#x4F7F;&#x5F97;&#x4EE3;&#x7801;&#x7684;&#x7EF4;&#x62A4;&#x66F4;&#x4E3A;&#x65B9;&#x4FBF;&#x3002;&#x5982;&#x679C;&#x5C06;&#x5E38;&#x91CF;&#x7EF4;&#x62A4;&#x5728;&#x5355;&#x72EC;&#x7684;&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;<a href="https://www.npmjs.com/package/eslint-plugin-import" target="_blank">&#x5728; <code><span class="token keyword">import</span></code> &#x65F6;&#x6821;&#x9A8C;</a>&#xFF0C;&#x80FD;&#x907F;&#x514D;&#x5076;&#x7136;&#x7684;&#x62FC;&#x5199;&#x9519;&#x8BEF;&#x3002;</p>
<h4 id="%E8%A1%A5%E5%85%85%E8%B5%84%E6%96%99">&#x8865;&#x5145;&#x8D44;&#x6599;</h4>
<p><strong>&#x6587;&#x6863;</strong></p>
<ul>
<li><a href="http://rackt.github.io/redux/docs/recipes/ReducingBoilerplate.html#actions" target="_blank">Reducing Boilerplate</a></li>
</ul>
<p><strong>Discussion</strong></p>
<ul>
<li><a href="https://github.com/reactjs/redux/issues/384" target="_blank">#384: Recommend that Action constants be named in the past tense</a></li>
<li><a href="https://github.com/reactjs/redux/issues/628" target="_blank">#628: Solution for simple action creation with less boilerplate</a></li>
<li><a href="https://github.com/reactjs/redux/issues/1024" target="_blank">#1024: Proposal: Declarative reducers</a></li>
<li><a href="https://github.com/reactjs/redux/issues/1167" target="_blank">#1167: Reducer without switch</a></li>
<li><a href="http://stackoverflow.com/q/34759047/62937" target="_blank">Stack Overflow: Why do you need &apos;Actions&apos; as data in Redux&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/q/34965856/62937" target="_blank">Stack Overflow: What is the point of the constants in Redux&#xFF1F;</a></li>
</ul>
<p><a id="actions-reducer-mappings"></a></p>
<h3 id="%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8-reducer-%E5%92%8C-action-%E4%B9%8B%E9%97%B4%E7%9A%84%E4%B8%80%E5%AF%B9%E4%B8%80%E6%98%A0%E5%B0%84%EF%BC%9F">&#x662F;&#x5426;&#x5B58;&#x5728; reducer &#x548C; action &#x4E4B;&#x95F4;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x6620;&#x5C04;&#xFF1F;</h3>
<p>&#x4E0D;&#x5B58;&#x5728;&#x3002;&#x5EFA;&#x8BAE;&#x7684;&#x65B9;&#x5F0F;&#x662F;&#x7F16;&#x5199;&#x72EC;&#x7ACB;&#x4E14;&#x5F88;&#x5C0F;&#x7684; reducer &#x65B9;&#x6CD5;&#x53BB;&#x66F4;&#x65B0;&#x6307;&#x5B9A;&#x7684; state &#x90E8;&#x5206;&#xFF0C;&#x8FD9;&#x79CD;&#x6A21;&#x5F0F;&#x88AB;&#x79F0;&#x4E3A; &#x201C;reducer &#x5408;&#x6210;&#x201D;&#x3002;&#x4E00;&#x4E2A;&#x6307;&#x5B9A;&#x7684; action &#x4E5F;&#x8BB8;&#x88AB;&#x5B83;&#x4EEC;&#x4E2D;&#x7684;&#x5168;&#x90E8;&#x3001;&#x90E8;&#x5206;&#x3001;&#x751A;&#x81F3;&#x6CA1;&#x6709;&#x4E00;&#x4E2A;&#x5904;&#x7406;&#x5230;&#x3002;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x628A;&#x7EC4;&#x4EF6;&#x4ECE;&#x5B9E;&#x9645;&#x7684;&#x6570;&#x636E;&#x53D8;&#x66F4;&#x4E2D;&#x89E3;&#x8026;&#xFF0C;&#x4E00;&#x4E2A; action &#x53EF;&#x80FD;&#x5F71;&#x54CD;&#x5230; state &#x6811;&#x7684;&#x4E0D;&#x540C;&#x90E8;&#x5206;&#xFF0C;&#x5BF9;&#x7EC4;&#x4EF6;&#x800C;&#x8A00;&#x518D;&#x4E5F;&#x4E0D;&#x5FC5;&#x77E5;&#x9053;&#x8FD9;&#x4E9B;&#x4E86;&#x3002;&#x6709;&#x4E9B;&#x7528;&#x6237;&#x9009;&#x62E9;&#x5C06;&#x5B83;&#x4EEC;&#x7D27;&#x5BC6;&#x7ED1;&#x5B9A;&#x5728;&#x4E00;&#x8D77;&#xFF0C;&#x5C31;&#x50CF; &#x201C;ducks&#x201D; &#x6587;&#x4EF6;&#x7ED3;&#x6784;&#xFF0C;&#x663E;&#x7136;&#x662F;&#x6CA1;&#x6709;&#x9ED8;&#x8BA4;&#x7684;&#x4E00;&#x5BF9;&#x4E00;&#x6620;&#x5C04;&#x3002;&#x6240;&#x4EE5;&#x5F53;&#x4F60;&#x60F3;&#x5728;&#x591A;&#x4E2A; reducer &#x4E2D;&#x5904;&#x7406;&#x540C;&#x4E00;&#x4E2A; action &#x65F6;&#xFF0C;&#x5E94;&#x5F53;&#x907F;&#x514D;&#x6B64;&#x7C7B;&#x7ED3;&#x6784;&#x3002;</p>
<h4 id="%E8%A1%A5%E5%85%85%E8%B5%84%E6%96%99">&#x8865;&#x5145;&#x8D44;&#x6599;</h4>
<p><strong>&#x6587;&#x6863;</strong></p>
<ul>
<li><a href="docs/basics/Reducers.md">Basics: Reducers</a></li>
<li><a href="docs/recipes/StructuringReducers.md">Recipes: Structuring Reducers</a></li>
</ul>
<p><strong>&#x8BA8;&#x8BBA;</strong></p>
<ul>
<li><a href="https://twitter.com/dan_abramov/status/682923564006248448" target="_blank">Twitter: most common Redux misconception</a></li>
<li><a href="https://github.com/reactjs/redux/issues/1167" target="_blank">#1167: Reducer without switch</a></li>
<li><a href="https://github.com/reduxible/reduxible/issues/8" target="_blank">Reduxible #8: Reducers and action creators aren&apos;t a one-to-one mapping</a></li>
<li><a href="http://stackoverflow.com/questions/35493352/can-i-dispatch-multiple-actions-without-redux-thunk-middleware/35642783" target="_blank">Stack Overflow: Can I dispatch multiple actions without Redux Thunk middleware&#xFF1F;</a></li>
</ul>
<p><a id="actions-side-effects"></a></p>
<h3 id="%E6%80%8E%E6%A0%B7%E8%A1%A8%E7%A4%BA%E7%B1%BB%E4%BC%BC-ajax-%E8%AF%B7%E6%B1%82%E7%9A%84-%E2%80%9C%E5%89%AF%E4%BD%9C%E7%94%A8%E2%80%9D%EF%BC%9F%E4%B8%BA%E4%BD%95%E9%9C%80%E8%A6%81-%E2%80%9Caction-%E5%88%9B%E5%BB%BA%E5%87%BD%E6%95%B0%E2%80%9D%E3%80%81%E2%80%9Cthunks%E2%80%9D-%E4%BB%A5%E5%8F%8A-%E2%80%9Cmiddleware%E2%80%9D-%E7%B1%BB%E4%BC%BC%E7%9A%84%E4%B8%9C%E8%A5%BF%E5%8E%BB%E5%A4%84%E7%90%86%E5%BC%82%E6%AD%A5%E8%A1%8C%E4%B8%BA%EF%BC%9F">&#x600E;&#x6837;&#x8868;&#x793A;&#x7C7B;&#x4F3C; AJAX &#x8BF7;&#x6C42;&#x7684; &#x201C;&#x526F;&#x4F5C;&#x7528;&#x201D;&#xFF1F;&#x4E3A;&#x4F55;&#x9700;&#x8981; &#x201C;action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x201D;&#x3001;&#x201C;thunks&#x201D; &#x4EE5;&#x53CA; &#x201C;middleware&#x201D; &#x7C7B;&#x4F3C;&#x7684;&#x4E1C;&#x897F;&#x53BB;&#x5904;&#x7406;&#x5F02;&#x6B65;&#x884C;&#x4E3A;&#xFF1F;</h3>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x6301;&#x4E45;&#x4E14;&#x590D;&#x6742;&#x7684;&#x8BDD;&#x9898;&#xFF0C;&#x9488;&#x5BF9;&#x5982;&#x4F55;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;&#x4EE5;&#x53CA;&#x91C7;&#x7528;&#x4F55;&#x79CD;&#x65B9;&#x5F0F;&#x6709;&#x5F88;&#x591A;&#x7684;&#x89C2;&#x70B9;&#x3002;</p>
<p>&#x4EFB;&#x4F55;&#x6709;&#x4EF7;&#x503C;&#x7684; web &#x5E94;&#x7528;&#x90FD;&#x5FC5;&#x7136;&#x8981;&#x6267;&#x884C;&#x590D;&#x6742;&#x7684;&#x903B;&#x8F91;&#xFF0C;&#x901A;&#x5E38;&#x5305;&#x62EC; AJAX &#x8BF7;&#x6C42;&#x7B49;&#x5F02;&#x6B65;&#x5DE5;&#x4F5C;&#x3002;&#x8FD9;&#x7C7B;&#x4EE3;&#x7801;&#x4E0D;&#x518D;&#x662F;&#x9488;&#x5BF9;&#x8F93;&#x5165;&#x7684;&#x7EAF;&#x51FD;&#x6570;&#xFF0C;&#x4E0E;&#x7B2C;&#x4E09;&#x65B9;&#x7684;&#x4EA4;&#x4E92;&#x88AB;&#x8BA4;&#x4E3A;&#x662F; <a href="https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29" target="_blank">&#x201C;&#x526F;&#x4F5C;&#x7528;&#x201D;</a>&#x3002;</p>
<p>Redux &#x6DF1;&#x53D7;&#x51FD;&#x6570;&#x5F0F;&#x7F16;&#x7A0B;&#x7684;&#x5F71;&#x54CD;&#xFF0C;&#x521B;&#x9020;&#x6027;&#x7684;&#x4E0D;&#x652F;&#x6301;&#x526F;&#x4F5C;&#x7528;&#x7684;&#x6267;&#x884C;&#x3002;&#x5C24;&#x5176;&#x662F; reducer&#xFF0C; <em>&#x5FC5;&#x987B;</em> &#x662F;&#x7B26;&#x5408;  <code><span class="token punctuation">(</span>state<span class="token punctuation">,</span> action<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">&gt;</span> newState</code> &#x7684;&#x7EAF;&#x51FD;&#x6570;&#x3002;&#x7136;&#x800C;&#xFF0C;Redux &#x7684; middleware &#x80FD;&#x62E6;&#x622A;&#x5206;&#x53D1;&#x7684; action &#x5E76;&#x6DFB;&#x52A0;&#x989D;&#x5916;&#x7684;&#x590D;&#x6742;&#x884C;&#x4E3A;&#xFF0C;&#x8FD8;&#x53EF;&#x4EE5;&#x6DFB;&#x52A0;&#x526F;&#x4F5C;&#x7528;&#x3002;</p>
<p>Redux &#x5EFA;&#x8BAE;&#x5C06;&#x5E26;&#x526F;&#x4F5C;&#x7528;&#x7684;&#x4EE3;&#x7801;&#x4F5C;&#x4E3A; action &#x521B;&#x5EFA;&#x8FC7;&#x7A0B;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x3002;&#x56E0;&#x4E3A;&#x8BE5;&#x903B;&#x8F91; <em>&#x80FD;</em> &#x5728; UI &#x7EC4;&#x4EF6;&#x5185;&#x6267;&#x884C;&#xFF0C;&#x90A3;&#x4E48;&#x901A;&#x5E38;&#x62BD;&#x53D6;&#x6B64;&#x7C7B;&#x903B;&#x8F91;&#x4F5C;&#x4E3A;&#x53EF;&#x91CD;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#x90FD;&#x662F;&#x6709;&#x610F;&#x4E49;&#x7684;&#xFF0C;&#x56E0;&#x6B64;&#x540C;&#x6837;&#x7684;&#x903B;&#x8F91;&#x80FD;&#x88AB;&#x591A;&#x4E2A;&#x5730;&#x65B9;&#x8C03;&#x7528;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x6240;&#x8C13;&#x7684; action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x3002;</p>
<p>&#x6700;&#x7B80;&#x5355;&#x4E5F;&#x662F;&#x6700;&#x5E38;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#x5C31;&#x662F;&#x4F7F;&#x7528; <a href="https://github.com/gaearon/redux-thunk" target="_blank">Redux Thunk</a> middleware&#xFF0C;&#x8FD9;&#x6837;&#x5C31;&#x80FD;&#x7528;&#x66F4;&#x4E3A;&#x590D;&#x6742;&#x6216;&#x8005;&#x5F02;&#x6B65;&#x7684;&#x903B;&#x8F91;&#x4E66;&#x5199; action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x3002;&#x53E6;&#x4E00;&#x4E2A;&#x88AB;&#x5E7F;&#x6CDB;&#x4F7F;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#x662F; <a href="https://github.com/yelouafi/redux-saga" target="_blank">Redux Saga</a>&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7528; generator &#x4E66;&#x5199;&#x7C7B;&#x540C;&#x6B65;&#x4EE3;&#x7801;&#xFF0C;&#x5C31;&#x50CF;&#x5728; Redux &#x5E94;&#x7528;&#x4E2D;&#x4F7F;&#x7528; &#x201C;&#x540E;&#x53F0;&#x7EBF;&#x7A0B;&#x201D; &#x6216;&#x8005; &#x201C;&#x5B88;&#x62A4;&#x8FDB;&#x7A0B;&#x201D;&#x3002;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;&#x662F; <a href="https://github.com/raisemarketplace/redux-loop" target="_blank">Redux Loop</a>&#xFF0C;&#x5B83;&#x5141;&#x8BB8; reducer &#x4EE5;&#x58F0;&#x660E;&#x526F;&#x4F5C;&#x7528;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x54CD;&#x5E94; state &#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8BA9;&#x5B83;&#x4EEC;&#x5206;&#x522B;&#x6267;&#x884C;&#xFF0C;&#x4ECE;&#x800C;&#x53CD;&#x8F6C;&#x4E86;&#x8FDB;&#x7A0B;&#x3002;&#x9664;&#x6B64;&#x4E4B;&#x5916;&#xFF0C;&#x8FD8;&#x6709; <em>&#x8BB8;&#x591A;</em> &#x5176;&#x5B83;&#x5F00;&#x6E90;&#x7684;&#x5E93;&#x548C;&#x7406;&#x5FF5;&#xFF0C;&#x90FD;&#x6709;&#x5404;&#x81EA;&#x9488;&#x5BF9;&#x526F;&#x4F5C;&#x7528;&#x7684;&#x7BA1;&#x7406;&#x65B9;&#x6CD5;&#x3002;</p>
<h4 id="%E8%A1%A5%E5%85%85%E8%B5%84%E6%96%99">&#x8865;&#x5145;&#x8D44;&#x6599;</h4>
<p><strong>&#x6587;&#x6863;</strong></p>
<ul>
<li><a href="advanced/AsyncActions.md">Advanced: Async Actions</a></li>
<li><a href="advanced/AsyncFlow.md">Advanced: Async Flow</a></li>
<li><a href="advanced/Middleware.md">Advanced: Middleware</a></li>
</ul>
<p><strong>&#x6587;&#x7AE0;</strong></p>
<ul>
<li><a href="https://medium.com/@fward/redux-side-effects-and-you-66f2e0842fc3" target="_blank">Redux side effects and you</a></li>
<li><a href="http://blog.hivejs.org/building-the-ui-2/" target="_blank">Pure functionality and side effects in Redux</a></li>
<li><a href="http://danmaz74.me/2015/08/19/from-flux-to-redux-async-actions-the-easy-way/" target="_blank">From Flux to Redux: Async Actions the easy way</a></li>
<li><a href="https://github.com/markerikson/react-redux-links/blob/master/redux-side-effects.md" target="_blank">React/Redux Links: &quot;Redux Side Effects&quot; category</a></li>
<li><a href="https://gist.github.com/markerikson/ea4d0a6ce56ee479fe8b356e099f857e" target="_blank">Gist: Redux-Thunk examples</a></li>
</ul>
<p><strong>&#x8BA8;&#x8BBA;</strong></p>
<ul>
<li><a href="https://github.com/reactjs/redux/issues/291" target="_blank">#291: Trying to put API calls in the right place</a></li>
<li><a href="https://github.com/reactjs/redux/issues/455" target="_blank">#455: Modeling side effects</a></li>
<li><a href="https://github.com/reactjs/redux/issues/533" target="_blank">#533: Simpler introduction to async action creators</a></li>
<li><a href="https://github.com/reactjs/redux/pull/569" target="_blank">#569: Proposal: API for explicit side effects</a></li>
<li><a href="https://github.com/reactjs/redux/issues/1139" target="_blank">#1139: An alternative side effect model based on generators and sagas</a></li>
<li><a href="http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux" target="_blank">Stack Overflow: Why do we need middleware for async flow in Redux&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559" target="_blank">Stack Overflow: How to dispatch a Redux action with a timeout&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/32982237/where-should-i-put-synchronous-side-effects-linked-to-actions-in-redux/33036344" target="_blank">Stack Overflow: Where should I put synchronous side effects linked to actions in redux&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/32925837/how-to-handle-complex-side-effects-in-redux/33036594" target="_blank">Stack Overflow: How to handle complex side-effects in Redux&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/33011729/how-to-unit-test-async-redux-actions-to-mock-ajax-response/33053465" target="_blank">Stack Overflow: How to unit test async Redux actions to mock ajax response</a></li>
<li><a href="http://stackoverflow.com/questions/35262692/how-to-fire-ajax-calls-in-response-to-the-state-changes-with-redux/35675447" target="_blank">Stack Overflow: How to fire AJAX calls in response to the state changes with Redux&#xFF1F;</a></li>
<li><a href="https://www.reddit.com/r/reactjs/comments/469iyc/help_performing_async_api_calls_with_reduxpromise/" target="_blank">Reddit: Help performing Async API calls with Redux-Promise Middleware.</a></li>
<li><a href="https://twitter.com/dan_abramov/status/689639582120415232" target="_blank">Twitter: possible comparison between sagas, loops, and other approaches</a></li>
</ul>
<p><a id="actions-multiple-actions"></a></p>
<h3 id="%E6%98%AF%E5%90%A6%E5%BA%94%E8%AF%A5%E5%9C%A8-action-%E5%88%9B%E5%BB%BA%E5%87%BD%E6%95%B0%E4%B8%AD%E8%BF%9E%E7%BB%AD%E5%88%86%E5%8F%91%E5%A4%9A%E4%B8%AA-action%EF%BC%9F">&#x662F;&#x5426;&#x5E94;&#x8BE5;&#x5728; action &#x521B;&#x5EFA;&#x51FD;&#x6570;&#x4E2D;&#x8FDE;&#x7EED;&#x5206;&#x53D1;&#x591A;&#x4E2A; action&#xFF1F;</h3>
<p>&#x5173;&#x4E8E;&#x5982;&#x4F55;&#x6784;&#x5EFA; action &#x5E76;&#x6CA1;&#x6709;&#x7EDF;&#x4E00;&#x7684;&#x89C4;&#x8303;&#x3002;&#x4F7F;&#x7528;&#x7C7B;&#x4F3C; Redux Thunk &#x7684;&#x5F02;&#x6B65; middleware &#x652F;&#x6301;&#x4E86;&#x66F4;&#x591A;&#x7684;&#x573A;&#x666F;&#xFF0C;&#x6BD4;&#x5982;&#x5206;&#x53D1;&#x8FDE;&#x7EED;&#x591A;&#x4E2A;&#x72EC;&#x7ACB;&#x4E14;&#x76F8;&#x5173;&#x8054;&#x7684; action&#x3001; &#x5206;&#x53D1; action &#x6307;&#x793A; AJAX &#x8BF7;&#x6C42;&#x7684;&#x9636;&#x6BB5;&#x3001; &#x6839;&#x636E; state &#x6709;&#x6761;&#x4EF6;&#x7684;&#x5206;&#x53D1; action&#x3001;&#x751A;&#x81F3;&#x5206;&#x53D1; action &#x5E76;&#x968F;&#x540E;&#x6821;&#x9A8C;&#x66F4;&#x65B0;&#x7684; state&#x3002;</p>
<p>&#x901A;&#x5E38;&#xFF0C;&#x660E;&#x786E;&#x8FD9;&#x4E9B; action &#x662F;&#x5173;&#x8054;&#x8FD8;&#x662F;&#x72EC;&#x7ACB;&#xFF0C;&#x662F;&#x5426;&#x5E94;&#x5F53;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A; action&#x3002;&#x8BC4;&#x5224;&#x5F53;&#x524D;&#x573A;&#x666F;&#x5F71;&#x54CD;&#x56E0;&#x7D20;&#x7684;&#x540C;&#x65F6;&#xFF0C;&#x8FD8;&#x9700;&#x6839;&#x636E; action &#x65E5;&#x5FD7;&#x6743;&#x8861; reducer &#x7684;&#x53EF;&#x8BFB;&#x6027;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x65B0; state &#x6811;&#x7684; action &#x4F1A;&#x4F7F;&#x4F60;&#x7684; reducer &#x53EA;&#x6709;&#x4E00;&#x884C;&#xFF0C;&#x526F;&#x4F5C;&#x7528;&#x662F;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5386;&#x53F2;&#x8868;&#x660E; <em>&#x4E3A;&#x4EC0;&#x4E48;</em> &#x53D1;&#x751F;&#x4E86;&#x53D8;&#x66F4;&#xFF0C;&#x8FDB;&#x800C;&#x5BFC;&#x81F4;&#x8C03;&#x8BD5;&#x5F02;&#x5E38;&#x56F0;&#x96BE;&#x3002;&#x53E6;&#x4E00;&#x65B9;&#x9762;&#xFF0C;&#x5982;&#x679C;&#x4E3A;&#x4E86;&#x7EF4;&#x6301;&#x5B83;&#x4EEC;&#x7684;&#x7C92;&#x72B6;&#x7ED3;&#x6784;&#xFF08;granular&#xFF09;&#xFF0C;&#x5728;&#x5FAA;&#x73AF;&#x4E2D;&#x5206;&#x53D1; action&#xFF0C;&#x8FD9;&#x8868;&#x660E;&#x4E5F;&#x8BB8;&#x9700;&#x8981;&#x5F15;&#x5165;&#x65B0;&#x7684; acton &#x7C7B;&#x578B;&#x5E76;&#x4EE5;&#x4E0D;&#x540C;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x5904;&#x7406;&#x5B83;&#x3002;</p>
<p>&#x907F;&#x514D;&#x5728;&#x540C;&#x4E00;&#x5730;&#x65B9;&#x8FDE;&#x7EED;&#x591A;&#x6B21;&#x4EE5;&#x540C;&#x6B65;&#x7684;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x5206;&#x53D1;&#xFF0C;&#x5176;&#x6027;&#x80FD;&#x95EE;&#x9898;&#x662F;&#x503C;&#x5F97;&#x62C5;&#x5FE7;&#x7684;&#x3002;&#x6709;&#x8BB8;&#x591A;&#x63D2;&#x4EF6;&#x548C;&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x6279;&#x5904;&#x7406;&#x8C03;&#x5EA6;&#x3002;</p>
<h4 id="%E8%A1%A5%E5%85%85%E8%B5%84%E6%96%99">&#x8865;&#x5145;&#x8D44;&#x6599;</h4>
<p><strong>&#x6587;&#x6863;</strong></p>
<ul>
<li><a href="https://github.com/reactjs/redux/blob/master/docs/faq/Performance.md#performance-update-events" target="_blank">FAQ: Performance - Reducing Update Events</a></li>
</ul>
<p><strong>&#x8BA8;&#x8BBA;</strong></p>
<ul>
<li><a href="https://github.com/reactjs/redux/issues/597" target="_blank">#597: Valid to dispatch multiple actions from an event handler&#xFF1F;</a></li>
<li><a href="https://github.com/reactjs/redux/issues/959" target="_blank">#959: Multiple actions one dispatch&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/33637740/should-i-use-one-or-several-action-types-to-represent-this-async-action/33816695" target="_blank">Stack Overflow: Should I use one or several action types to represent this async action&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/35406707/do-events-and-actions-have-a-11-relationship-in-redux/35410524" target="_blank">Stack Overflow: Do events and actions have a 1:1 relationship in Redux&#xFF1F;</a></li>
<li><a href="http://stackoverflow.com/questions/33220776/should-actions-like-showing-hiding-loading-screens-be-handled-by-reducers-to-rel/33226443#33226443" target="_blank">Stack Overflow: Should actions be handled by reducers to related actions or generated by action creators themselves&#xFF1F;</a></li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../docs/faq/StoreSetup.html" class="navigation navigation-prev " aria-label="Previous page: 创建 Store"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../docs/faq/CodeStructure.html" class="navigation navigation-next " aria-label="Next page: 代码结构"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-edit-link/plugin.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-ga/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2},"edit-link":{"base":"https://github.com/camsong/redux-in-chinese/tree/master","label":"开始纠错"},"ga":{"token":"UA-66122997-1","configuration":"auto"}};
    gitbook.start(config);
});
</script>

        <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-66122997-1', 'auto');ga('send', 'pageview');</script>
    </body>
    
</html>
